﻿<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Master_Page/Master_IPORT.Master" CodeBehind="VehicleMaster.aspx.vb" Inherits="I_PORT.VehicleMaster" 
    title="IRPC INTELLIGENT PORT SERVICE" %>
    
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript" language="javascript">
        function closeModal() {
           document.getElementById('ctl00_contentplaceholder1_framePopup').src = '../MasterPopup/Vehicle_Popup.aspx';
            var mpu = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender1');
            mpu.hide();
        }
        function showPopup() {
             document.getElementById('ctl00_contentplaceholder1_framePopup').contentWindow.location.reload(true);
        }
</script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
  <ContentTemplate>
     <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
             <td style="width:20%;" align="right"><asp:Label ID="lbNameVehicle" runat="server" SkinID="lbtxt" Text="Vessel :"></asp:Label>&nbsp;</td>
             <td align="left"><asp:TextBox ID="txtVehicle" runat="server"></asp:TextBox>
             <asp:Button ID="btnSearch" runat="server" Text="ค้นหา" CssClass="ButtonStyle" />
             </td>
        </tr>
        <tr>
           <td style="height:5px;"><img src="../Image/space.gif" /></td>
        </tr>
        <tr>
           <td align="center" colspan="2">
              <asp:GridView ID="gridVehicle" runat="server" SkinID="gridblue"  DataKeyNames="VEHICLE,VEH_LENGTH,VEH_WIDTH,VEH_HEIGHT,DRAFT,VEH_MAXWGT_C,VEH_MAXVOL_C,STCMNR,REG_CNTRY,VEH_TEXT,OWNER"
                     AutoGenerateColumns="False">
                     <PagerTemplate>
                                            <table>
                                                <tr>
                                                    <td>
                                                        <asp:ImageButton ID="ImgFirst" runat="server" Height="22px" ImageUrl="../Image/arrow-first.gif"
                                                            OnCommand="Paginate" CommandArgument="First" CommandName="Page" />
                                                    </td>
                                                    <td>
                                                        <asp:ImageButton ID="ImgBack" runat="server" Height="22px" ImageUrl="../Image/arrow-back.gif"
                                                            OnCommand="Paginate" CommandArgument="Prev" CommandName="Page" />
                                                    </td>
                                                    <td valign="top">
                                                        Page
                                                        <asp:DropDownList ID="ddlPage" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlPage_SelectedIndexChanged">
                                                        </asp:DropDownList>
                                                        of
                                                        <asp:Label ID="lbPageCount" runat="server" Text="Label"></asp:Label>
                                                    </td>
                                                    <td>
                                                        <asp:ImageButton ID="ImgNext" runat="server" Height="22px" ImageUrl="../Image/arrow-next.gif"
                                                            OnCommand="Paginate" CommandArgument="Next" CommandName="Page" />
                                                    </td>
                                                    <td>
                                                        <asp:ImageButton ID="ImgEnd" runat="server" Height="22px" ImageUrl="../Image/arrow-end.gif"
                                                            OnCommand="Paginate" CommandArgument="Last" CommandName="Page" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </PagerTemplate>
                     <Columns> 
                         <asp:BoundField HeaderText="VESSEL" DataField="VEH_TEXT" />
                         <asp:BoundField HeaderText="OWNER" DataField="OWNER" />
                         <asp:BoundField HeaderText="COUNTRY" DataField="REG_CNTRY" />
                         <asp:TemplateField HeaderText="แก้ไข" ItemStyle-Width="50px">
                             <ItemTemplate>
                                 <asp:ImageButton ID="imgedit" CommandName="cmdedit" CommandArgument="<%# Container.DataItemIndex %>"  runat="server" ImageUrl="~/Image/edit-24.gif" />
                             </ItemTemplate>
                         </asp:TemplateField>
                     </Columns>
                 </asp:GridView>
           </td>
        </tr>
        <tr>
             <td style="width:20%;" align="right"><asp:Label ID="Label1" runat="server" SkinID="lbtxt" Text="Vessel :"></asp:Label>&nbsp;</td>
             <td align="left">
                 <asp:RadioButtonList ID="radioTypeConnect" runat="server" SkinID="raio" AutoPostBack="true" RepeatDirection="Horizontal" >
                   <asp:ListItem Value="0" Selected="True">Update ข้อมูลตามช่วงรหัส</asp:ListItem>
                   <asp:ListItem Value="1">Update เฉพาะข้อมูลเรือใหม่</asp:ListItem>
                 </asp:RadioButtonList>
             </td>
        </tr>
        <tr id="rowVessel" runat="server">
           <td colspan="2" >
             <table width="100%" border="0" cellpadding="0" cellspacing="0" >
                <tr>
                   <td style="width:20%;" align="right"><asp:Label ID="Label2" runat="server" SkinID="lbtxt" Text="From :"></asp:Label>&nbsp;</td>
             <td align="left">
                 <asp:TextBox ID="txtFrom" runat="server"></asp:TextBox>
             </td>
                </tr>
                <tr>
                   <td style="width:20%;" align="right"><asp:Label ID="Label3" runat="server" SkinID="lbtxt" Text="To :"></asp:Label>&nbsp;</td>
                   <td align="left">
                         <asp:TextBox ID="txtTo" runat="server"></asp:TextBox>
                    </td>
                </tr>
             </table>
           </td>
        </tr>
        <tr>
           <td style="width:20%;" align="right"></td>
           <td align="left">
              <asp:Button ID="btnUpdate" runat="server" Text="Update Vessel" CssClass="ButtonStyle" />
              <asp:Button ID="btnAdd" runat="server" Text="Add Relation" CssClass="ButtonStyle" OnClientClick="showTariff();" style="display:none" />
           </td>
        </tr>
     </table>
    <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BackgroundCssClass="Background"
     TargetControlID="btnAdd" PopupControlID="PopupAdd" >
    </asp:ModalPopupExtender>
    <asp:Panel ID="PopupAdd" runat="server" Style="display: none;">
        <table>
            <tr>
                <td>
                    <iframe runat="server" id="framePopup" class="Style-Iframe" marginheight="0px" marginwidth="0px" src="../MasterPopup/Vehicle_Popup.aspx" >
                    </iframe>
                </td>
            </tr>
        </table>
    </asp:Panel>
    </ContentTemplate>
</asp:UpdatePanel>
<%--<script type="text/javascript"> 
tabdropdown.init("colortab", 2)
</script>--%>
</asp:Content>
